import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入自定义函数方法
import fun from './components/common/myfunction'
// 全局样式
import './assets/css/global.css'
// 字体图标
import './assets/fonts/iconfont.css'

// brand
import Brand from './components/common/brand.vue'

// // 导入axios
import axios from 'axios'
// // 引入请求中心文件
import Http from './index.js'
// // UI框架
// import ElementUI from 'element-ui'
// import 'element-ui/lib/theme-chalk/index.css'
// // 导入树形控件
import ZkTable from 'vue-table-with-tree-grid'

Vue.component(ZkTable.name, ZkTable)

Vue.config.productionTip = false

Vue.prototype.$Url = 'http://127.0.0.1:8888/api/private/v1/'
// 配置请求的基准URL地址
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1/'

// axios设置请求拦截器
axios.interceptors.request.use(
  config => {
    //  设置响应头
    config.headers.Authorization = window.sessionStorage.getItem('token')
    return config
  },
  err => {
    console.log(err)
  }
)
Vue.prototype.$http = axios
Vue.prototype.$Http = Http
Vue.filter('dateFrom', (e) => fun.moment(e))
// Vue.prototype.$fun = fun

Vue.component('brand', Brand)
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
